package com.yonyou.lxp.xutils3test.mvp.user.presenter;

import android.view.View;

import com.yonyou.lxp.xutils3test.mvp.user.mode.IMUser;
import com.yonyou.lxp.xutils3test.mvp.user.mode.MUser;
import com.yonyou.lxp.xutils3test.mvp.user.view.IUser;
import com.yonyou.lxp.xutils3test.mvp.user.view.UserActivity;

/**
 * 作者： liuxiaopeng on 16/3/22.
 * 描述：
 */
public class PUser implements IPUser {
    private IUser iUser;   //6 拥有View与Model
    private IMUser imUser;

    public PUser(UserActivity iUser) {
        this.iUser = iUser;
        imUser = new MUser();
    }

    @Override
    public void onCreate() {

    }

    @Override
    public void performOnClick() {
        imUser.getData(new IMUser.ICallBack() {
            @Override
            public void onResult(String data) {
                iUser.SetData(data);
            }
        });
    }
}

//Presenter的接口
interface IPUser {
    void onCreate();

    void performOnClick();
}